let vm = new Vue({
    el: '.main-content',
    data: {
        menu: {}
    },
    methods: {
        doUpdate: function () {
            axios({
                url: `mapper/resource/doUpdate`,
                method: "post",
                data: this.menu
            }).then(response => {
                if (response.data.success) {
                    let index = parent.layer.getFrameIndex(window.name);
                    console.log(index);
                    parent.layer.close(index)
                }else {
                    layer.msg(response.data.msg)
                }
            }).catch(error => {
                layer.msg(error.message)
            })
        },
        toModules: function () {
            layer.open({
                type: 2,      //表示弹出一个iframe
                title: false,  //是否设置标题
                // closeBtn: 0, //不显示关闭按钮
                // shade: [0],
                area: ['100%', '100%'],  //设置子窗口的宽高
                // offset: 'rb', //右下角弹出    //默认中间
                // time: 20000, //20秒后自动关闭
                // anim: 2,
                content: 'mapper/resource/toModules', //iframe的url
                end: () => { //此处用于演示
                    if (layer.icon !== 0 && layer.icon.length > 0) {
                        this.menu.icon = layer.icon;
                    }
                }
            })
        },
    },
    created: function () {
        this.menu = parent.layer.obj;
    }

});